<?php
include("../meihe/common.php");
$act = isset($_GET['act']) ? daddslashes($_GET['act']) : null;

@header('Content-Type: application/json; charset=UTF-8');

switch ($act) {
    case 'add_workorder':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录！"}');
        $type = intval($_POST['type']);
        $content = str_replace(array('*', '^', '|'), '', trim(strip_tags(daddslashes($_POST['content']))));
        $picurl = strip_tags(daddslashes($_POST['picurl']));
        if (empty($content)) {
            exit('{"code":-1,"msg":"描述信息不能为空！"}');
        } else {
            $sql = "INSERT INTO `meihe_workorder` (`zid`,`type`,`content`,`picurl`,`addtime`,`status`) VALUES ('" . $userrow['zid'] . "', '" . $type . "', '" . $content . "', '" . $picurl . "', '" . $date . "', '0')";
            if ($DB->query($sql)) {
                if ($conf['workorder_mail'] == 1) {
                    $content = mb_substr($content, 0, 16, 'utf-8');
                    $sub = '用户提交工单提醒';
                    $text = '<b>' . $userrow['user'] . '</b>（zid:' . $userrow['zid'] . '）于 ' . $date . ' 提交工单，请及时进入网站后台工单列表处理。<br/><b>问题类型：</b>' . display_type($type) . '<br/><b>工单标题：</b>' . $content . '<br/>----------<br/>' . $_SERVER['HTTP_HOST'] . '<br/>' . $date;
                    $msg = youfas($sub, $text);
                    $mail_name = $conf['mail_recv'] ? $conf['mail_recv'] : $conf['mail_name'];
                    send_mail($mail_name, $sub, $msg);
                }
                exit('{"code":0,"msg":"提交工单成功！请等待管理员处理。"}');
            } else {
                exit('{"code":-1,"msg":"提交工单失败！' . $DB->error() . '"}');
            }
        }
        break;
    case 'user_recharge':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录！"}');
        $id = intval($_POST['id']);
        $title = $_POST['title'];
        $row = $DB->get_row("select * from meihe_report where id='$id' limit 1");
        if (!$row) {
            exit('{"code":-1,"msg":"当前域名不存在！"}');
        }
        if ($row['upzid'] != $userrow['zid']) {
            exit('{"code":-1,"msg":"不是你的记录无法修改！"}');
        }
        $url_arr = parse_url($row['url']);
        $domain = $url_arr['host'];
        $rowb = $DB->get_row("SELECT * FROM meihe_list WHERE domain='" . $domain . "' limit 1");
        if ($rowb['type'] != 1) {
            exit('{"code":-1,"msg":"非会员无法更改！"}');
        }
        if ($DB->query("update meihe_report set title='$title' where id='{$id}'")) {
            exit('{"code":0,"msg":"成功"}');
        } else {
            exit('{"code":-1,"msg":"修改标题失败！' . $DB->error() . '"}');
        }
        break;
    case 'reply_workorder':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录！"}');
        $id = intval($_GET['id']);
        $rows = $DB->get_row("SELECT * FROM meihe_workorder WHERE id='$id' AND zid='{$userrow['zid']}' LIMIT 1");
        if (!$rows) {
            exit('{"code":-1,"msg":"当前记录不存在！"}');
        } elseif ($rows['status'] == 2) {
            exit('{"code":-1,"msg":"此工单已经结单！"}');
        } elseif ($rows['status'] == 0) {
            exit('{"code":-1,"msg":"请耐心等待客服处理！"}');
        }
        $content = str_replace(array('*', '^', '|'), '', trim(strip_tags(daddslashes($_POST['content']))));
        if (empty($content)) {
            exit('{"code":-1,"msg":"补充信息不能为空！"}');
        } else {
            $content = addslashes($rows['content']) . '*0^' . $date . '^' . $content;
            if ($DB->query("update meihe_workorder set content='{$content}',status=0 where id='{$id}'")) {
                exit('{"code":0,"msg":"回复工单成功！请等待管理员处理。"}');
            } else {
                exit('{"code":-1,"msg":"回复工单失败！' . $DB->error() . '"}');
            }
        }
        break;
    case 'complete_workorder':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录！"}');
        $id = intval($_GET['id']);
        $rows = $DB->get_row("SELECT * FROM meihe_workorder WHERE id='$id' AND zid='{$userrow['zid']}' LIMIT 1");
        if (!$rows) {
            exit('{"code":-1,"msg":"当前记录不存在！"}');
        } elseif ($rows['status'] == 2) {
            exit('{"code":-1,"msg":"此工单已经结单！"}');
        }
        if ($DB->query("UPDATE meihe_workorder SET status=2 WHERE id='{$id}'")) {
            exit('{"code":0,"msg":"完结工单成功！"}');
        } else {
            exit('{"code":-1,"msg":"完结工单失败！' . $DB->error() . '"}');
        }
        break;
    case 'add_key':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录！"}');
        $key = random(32);
        $sql = "update meihe_user set api_key='" . $key . "' where zid='" . $userrow['zid'] . "';";
        if ($DB->query($sql)) {
            exit('{"code":1,"msg":"APIKEY开通成功！"}');
        } else {
            exit('{"code":-1,"msg":"APIKEY开通失败！' . $DB->error() . '"}');
        }
        break;
    case 'api_key':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录！"}');
        if (isset($_SESSION['api_key']) && $_SESSION['api_key'] > TIMESTAMP - 600) {
            exit('{"code":-1,"msg":"请勿频繁重置！"}');
        }
        $key = random(32);
        $sql = "update meihe_user set api_key='" . $key . "' where zid='" . $userrow['zid'] . "';";
        if ($DB->query($sql)) {
            $_SESSION['api_key'] = TIMESTAMP;
            exit('{"code":1,"msg":"APIKEY重置成功！"}');
        } else {
            exit('{"code":-1,"msg":"APIKEY重置失败！' . $DB->error() . '"}');
        }
        break;
    case 'checkuser':
        $user = daddslashes($_GET['user']);
        $srow = $DB->get_row("SELECT * FROM meihe_user WHERE user='{$user}' limit 1");
        if ($srow) exit('1');
        else exit('0');
        break;
    case 'meihe':
        $result = array("code" => 0, "hyhbmd" => $hyhbmd, "hyvip" => $hyvip, "sczs" => $sczs, "fwjl" => $fwjl, "chart" => getDatePoint());
        exit(json_encode($result));
        break;
    case 'qiandao':
        if ($islogin2 != 1) exit('{"code":-1,"msg":"未登录！"}');
        if ($conf['qiandao_open'] != 1) exit('{"code":-1,"msg":"当前站点未开启签到功能"}');
        $day = date("Y-m-d");
        $lastday = date("Y-m-d", strtotime("-1 day"));
        if ($DB->get_row("SELECT * FROM meihe_qiandao WHERE uid='{$userrow['zid']}' and date='$day' order by id desc limit 1")) {
            exit('{"code":-1,"msg":"今天已经签到过了, 明天在来吧！"}');
        }
        if ($row = $DB->get_row("SELECT * FROM meihe_qiandao WHERE uid='{$userrow['zid']}' and date='$lastday' order by id desc limit 1")) {
            $continue = $row['continue'] + 1;
        } else {
            $continue = 1;
        }
        $reward = round($conf['qiandao_min'] + mt_rand() / mt_getrandmax() * ($conf['qiandao_max'] - $conf['qiandao_min']), 2);
        if ($reward == 0) {
            $text = '运气有点呗哦，没有获得现金奖励，明日再接再来哦！';
        } elseif ($reward == $conf['qiandao_money']) {
            $text = '运气有点呗哦，没有获得现金奖励，明日再接再来哦！';
        } elseif ($reward > $conf['qiandao_money']) {
            $text = '哇，运气爆表了，获得' . $reward . '元现金奖励！';
        } elseif ($reward < $conf['qiandao_money']) {
            $text = '不用灰心哦，明日再接再厉，获得' . $reward . '元现金奖励！';
        } else {
            $text = '签到成功，获得' . $reward . '元现金奖励！';
        }
        $money = round($reward - $conf['qiandao_money'], 2);
        $sql = "insert into `meihe_qiandao` (`uid`,`qq`,`reward`,`date`,`time`,`continue`) values ('" . $userrow['zid'] . "','" . $userrow['qq'] . "','" . $reward . "','" . $day . "','" . $date . "','" . $continue . "')";
        if ($DB->query($sql)) {
            if ($money > 0) {
                $DB->query("update meihe_user set rmb=rmb+{$money} where zid='{$userrow['zid']}'");
                $DB->query("insert into `meihe_logo` (`czxm`,`cznr`,`time`,`click_time`,`upzid`,`ip_address`) values ('用户签到','用户获得" . $money . "元','" . TIMESTAMP . "','" . $date . "','" . $userrow['qq'] . "','" . real_ip() . "')");
            }
            $result = array('code' => 0, 'msg' => $text);
        } else {
            $result = array('code' => -1, 'msg' => '签到失败' . $DB->error());
        }
        exit(json_encode($result));
        break;
    case 'qdcount':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录！"}');
        $day = date("Y-m-d");
        $lastday = date("Y-m-d", strtotime("-1 day"));
        $count1 = $DB->count("SELECT count(*) FROM meihe_qiandao WHERE date='$day'");
        $count2 = $DB->count("SELECT count(*) FROM meihe_qiandao WHERE date='$lastday'");
        $count3 = $DB->count("SELECT count(*) FROM meihe_qiandao");
        $rewardcount = $DB->count("SELECT sum(reward) FROM meihe_qiandao WHERE uid='{$userrow['zid']}'");
        $result = array("count1" => $count1, "count2" => $count2, "count3" => $count3, "rewardcount" => round($rewardcount, 2));
        exit(json_encode($result));
        break;
    case 'qrcode':
        $image = trim($_POST['image']);
        $result = qrcodelogin($image);
        exit(json_encode($result));
        break;
    case 'uppower':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录"}');
        $power = intval($_POST['power']);
        $fenzhan_expiry2 = $conf['fenzhan_expiry2'] > 0 ? $conf['fenzhan_expiry2'] : 12;
        $endtime = date("Y-m-d H:i:s", strtotime("+ {$fenzhan_expiry2} months", time()));
        $price = $conf['sjgzyh'];
        if ($price > $userrow['rmb']) {
            $moneys = $price - $userrow['rmb'];
            exit('{"code":-1,"msg":"您的余额不足，本次升级需要' . $price . '元，还差' . $moneys . '元，请充值余额！"}');
        }
        $DB->query("update `meihe_user` set `power`=2,`endtime`='{$endtime}',`rmb`=`rmb`-'{$price}' WHERE `zid`='{$userrow['zid']}'");
        $DB->query("insert into `meihe_logo` (`czxm`,`cznr`,`time`,`click_time`,`upzid`,`ip_address`) values ('升级权限','用户中心升级权限等级','" . TIMESTAMP . "','" . $date . "','" . $userrow['qq'] . "','" . real_ip() . "')");
        exit('{"code":1,"msg":"升级贵族用户成功！"}');
        break;
    case 'xfzhpp':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录"}');
        $fenzhan_expiry2 = $conf['fenzhan_expiry2'] > 0 ? $conf['fenzhan_expiry2'] : 12;
        if ($userrow['endtime'] > date("Y-m-d")) $endtime = date("Y-m-d", strtotime("+               {$fenzhan_expiry2} months", strtotime($userrow['endtime'])));
        else $endtime = date("Y-m-d", strtotime("+ {$fenzhan_expiry2} months"));
        $price = $conf['xfzh'];
        if ($price > $userrow['rmb']) {
            $moneys = $price - $userrow['rmb'];
            exit('{"code":-1,"msg":"您的余额不足，本次续费需要' . $price . '元，还差' . $moneys . '元，请充值余额！"}');
        }
        $DB->query("update `meihe_user` set `endtime`='{$endtime}',`rmb`=`rmb`-'{$price}' WHERE `zid`='{$userrow['zid']}'");
        $DB->query("insert into `meihe_logo` (`czxm`,`cznr`,`time`,`click_time`,`upzid`,`ip_address`) values ('续费会员','用户中心续费会员','" . TIMESTAMP . "','" . $date . "','" . $userrow['qq'] . "','" . real_ip() . "')");
        exit('{"code":1,"msg":"续费账号成功！"}');
        break;
    case 'kthy':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录"}');
        $rs = $DB->query("SELECT * FROM meihe_list WHERE 1 and upzid='{$userrow['zid']}'");
        while ($res = $DB->fetch($rs)) {
            $data[] = array(
                "id" => $res['id'],
                "domain" => $res['domain'],
                "qq" => $res['qq'],
                "ktsj" => $res['date'],
                "dqsj" => $res['endtime']
            );
        }
        $count = $DB->count("SELECT * FROM meihe_list WHERE `type`='1' ");
        $jsonArray = ['code' => 0, 'msg' => '', 'count' => $count, 'data' => $data];

        print(json_encode($jsonArray, JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
        break;
    case 'ktmd':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录"}');
        $rs = $DB->query("SELECT * FROM meihe_hbmd WHERE 1 and upzid='{$userrow['zid']}'");
        while ($res = $DB->fetch($rs)) {
            $data[] = array(
                "id" => $res['id'],
                "domain" => $res['domain'],
                "ktsj" => $res['date']
            );
        }
        $count = $DB->count("SELECT * FROM meihe_hbmd WHERE `type`='3' ");
        $jsonArray = ['code' => 0, 'msg' => '', 'count' => $count, 'data' => $data];
        print(json_encode($jsonArray, JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
        break;
    case 'msginfo':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录"}');
        $id = intval($_GET['id']);
        $row = $DB->get_row("select * from meihe_message where id='$id' and active=1 limit 1");
        if (!$row)
            exit('{"code":-1,"msg":"当前消息不存在！"}');
        if (!in_array($id, explode(',', $userrow['msgread']))) {
            $msgread_n = $userrow['msgread'] . $id . ',';
            $DB->query("UPDATE meihe_message SET count=count+1 WHERE id='$id'");
            $DB->query("UPDATE meihe_user SET msgread='" . $msgread_n . "' WHERE zid='{$userrow['zid']}'");
        }
        $result = array("code" => 0, "msg" => "succ", "title" => $row['title'], "type" => $row['type'], "content" => $row['content'], "date" => $row['addtime']);
        exit(json_encode($result));
        break;
    case 'login':
        if (isset($_POST['user']) && isset($_POST['pass'])) {
            $user = daddslashes($_POST['user']);
            $pass = daddslashes($_POST['pass']);
            $row = $DB->get_row("SELECT * FROM meihe_user WHERE user='$user' limit 1");
            if ($row && $user === $row['user'] && $pass === $row['pwd']) {
                if ($row['active'] == 1) {
                    exit('{"code":-1,"msg":"当前账号已被封禁！"}');
                } else if ($userrow['power'] != 1) {
                    if ($userrow['power'] > 0 && $userrow['endtime'] < $date) {
                        exit('{"code":-1,"msg":"你的账号已到期，请联系管理员续费！"}');
                    }
                }
                $session = md5($user . $pass . $password_hash);
                $token = authcode("{$row['zid']}\t{$session}", 'ENCODE', SYS_KEY);
                setcookie("user_token", $token, time() + 604800, '/');
                $DB->query("update meihe_user set lasttime='$date' where zid='{$row['zid']}'");
                @header('Content-Type: text/html; charset=UTF-8');
                $DB->query("insert into `meihe_logo` (`czxm`,`cznr`,`time`,`click_time`,`upzid`,`ip_address`) values ('用户登录中心','用户后台登录','" . TIMESTAMP . "','" . $date . "','" . $userrow['qq'] . "','" . real_ip() . "')");
                exit('{"code":1,"msg":"尊敬的' . $row['user'] . ',欢迎回来！"}');
            } else {
                @header('Content-Type: text/html; charset=UTF-8');
                exit('{"code":-1,"msg":"用户名或用户密码错误！"}');
            }
        } elseif (isset($_GET['logout'])) {
            setcookie("user_token", "", time() - 604800, '/');
            @header('Content-Type: text/html; charset=UTF-8');
            exit('{"code":0,"msg":"注销完毕！正在退出"}');
        } elseif ($islogin2 == 1) {
            @header('Content-Type: text/html; charset=UTF-8');
            exit('{"code":1,"msg":"您已经登录","url":"./"}');
        }
        break;
    case 'recharge':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录"}');
        $value = daddslashes($_GET['value']);
        $trade_no = date("YmdHis") . rand(111, 999);
        if ($value < $conf['recharge_min']) exit('{"code":-1,"msg":"最低充值' . $conf['recharge_min'] . '元！"}');
        if ($value > $conf['recharge_max']) exit('{"code":-1,"msg":"最高充值' . $conf['recharge_max'] . '元！"}');
        if (!is_numeric($value) || !preg_match('/^[0-9.]+$/', $value)) exit('{"code":-1,"msg":"提交参数错误！"}');
        $sql = "insert into `meihe_pay` (`trade_no`,`tid`,`input`,`name`,`money`,`ip`,`addtime`,`status`) values ('" . $trade_no . "','-1','" . $userrow['zid'] . "','在线充值余额','" . $value . "','" . $clientip . "','" . $date . "','0')";
        if ($DB->query($sql)) {
            exit('{"code":0,"msg":"提交订单成功！","trade_no":"' . $trade_no . '","money":"' . $value . '","name":"在线充值余额"}');
        } else {
            exit('{"code":-1,"msg":"提交订单失败！' . $DB->error() . '"}');
        }
        break;
    case 'setClass':
        if (!$islogin2) exit('{"code":-1,"msg":"未登录"}');
        $cid = intval($_GET['cid']);
        $active = intval($_GET['active']);
        $classhide = explode(',', $row['class']);
        if ($active == 1 && in_array($cid, $classhide)) {
            $classhide = array_diff($classhide, array($cid));
        } elseif ($active == 0 && !in_array($cid, $classhide)) {
            $classhide[] = $cid;
        }
        $class = implode(',', $classhide);
        $DB->query("update `meihe_user` set `class`='{$class}' where zid='{$row['zid']}'");
        exit('{"code":0}');
        break;

    case 'email';
        if (isset($_POST['qq'])) {
            $qq = daddslashes($_POST['qq']);
            $row = $DB->get_row("SELECT * FROM meihe_user WHERE qq='{$qq}' limit 1");
            if ($row) {
                exit('{"code":-1,"msg":"用户中心已存在该QQ！"}');
            }
            $email = $qq . '@qq.com';
            $sub = '' . $conf['sitename'] . ' - 注册验证码';
            $code = rand(1111111, 9999999);
            setcookie('authcode', md5($code), time() + 60 * 1);
            $text = '您的验证码为 : ' . $code . '，60秒内有效请及时验证。';
            $msg = youfas($sub, $text);
            $result = send_mail($email, $sub, $msg);
            if ($result) {
                $_SESSION['mail_find'] = time();
                $DB->query("insert into `meihe_logo` (`czxm`,`cznr`,`time`,`click_time`,`upzid`,`ip_address`) values ('注册验证码','注册验证码为:" . $code . "','" . TIMESTAMP . "','" . $date . "','" . $qq . "','" . real_ip() . "')");
                exit('{"code":1,"msg":"发送验证码成功,请进入QQ邮箱查看！"}');
            } else {
                exit('{"code":-1,"msg":"邮件发送失败，请重试！"}');
            }
        }
        break;
    case 'email2';
        if (isset($_POST['qq'])) {
            $qq = daddslashes($_POST['qq']);
            $row = $DB->get_row("SELECT * FROM meihe_list WHERE qq='{$qq}' limit 1");
            if ($row == '') {
                exit('{"code":-1,"msg":"平台不存在该QQ，无法发送！"}');
            }
            $email = $qq . '@qq.com';
            $sub = '' . $conf['sitename'] . ' - 更换验证码';
            $code = rand(1111111, 9999999);
            setcookie('authcode', md5($code), time() + 60 * 1);
            $text = '您的验证码为 : ' . $code . '，60秒内有效请及时验证。';
            $msg = youfas($sub, $text);
            $result = send_mail($email, $sub, $msg);
            if ($result) {
                $_SESSION['mail_find'] = time();
                $DB->query("insert into `meihe_logo` (`czxm`,`cznr`,`time`,`click_time`,`upzid`,`ip_address`) values ('更换验证码','更换验证码为:" . $code . "','" . TIMESTAMP . "','" . $date . "','" . $qq . "','" . real_ip() . "')");
                exit('{"code":1,"msg":"发送验证码成功,请进入QQ邮箱查看！"}');
            } else {
                exit('{"code":-1,"msg":"邮件发送失败，请重试！"}');
            }
        }
        break;
    case 'reg';
        $power = $_POST['power'] ?? '';
        $user = $_POST['user']; //账号
        $pass = $_POST['pass']; //密码
        $pass_confirm = $_POST['pass_confirm'];
        $qq = $_POST['qq']; //QQ账号
        $code = intval($_POST['code'] ?? 0); //验证码
        $row = $DB->get_row("select * from meihe_user where user='$user'");
        $rowqq = $DB->get_row("SELECT * FROM meihe_user WHERE qq='$qq' limit 1");
        if (!preg_match('/^[a-zA-Z0-9]+$/', $user)) {
            exit('{"code":-1,"msg":"用户名只能为英文或数字！"}');
        } elseif (strlen($user) < 3) {
            exit('{"code":-1,"msg":"用户名太短！"}');
        } elseif (strlen($user) > 20) {
            exit('{"code":-1,"msg":"用户名太长！"}');
        } elseif (strlen($pass) < 6) {
            exit('{"code":-1,"msg":"密码不能低于6位！"}');
        } elseif (strlen($pass) > 30) {
            exit('{"code":-1,"msg":"密码太长！"}');
        } elseif ($pass != $pass_confirm) {
            exit('{"code":-1,"msg":"两次密码不同，请重新输入！"}');
        } elseif (strlen($qq) < 5 || !preg_match('/^[0-9]+$/', $qq)) {
            exit('{"code":-1,"msg":"QQ格式不正确！"}');
        } elseif ($rowqq) {
            exit('{"code":-1,"msg":"QQ已经注册过！"}');
        } elseif ($user == $pass) {
            exit('{"code":-1,"msg":"账号密码相同，禁止注册！"}');
        } elseif ($user == $row['user']) {
            exit('{"code":-1,"msg":"该用户名已存在,请重新选择一个！"}');
        }
        $conf['yxzckg'] = $conf['yxzckg'] ?? 0;
        if ($conf['yxzckg'] == 2) {
            if (md5($code) != $_COOKIE['authcode']) {
                @header('Content-Type: text/html; charset=UTF-8');
                exit('{"code":-1,"msg":"验证码错误，请重新获取！"}');
            }
        }
        $status = 1;
        $sql = "insert into `meihe_user` (`upzid`,`power`,`user`,`pwd`,`rmb`,`qq`,`addtime`,`status`) values ('1','1','" . $user . "','" . $pass . "','" . $conf['fenzhan_free'] ?? null . "','" . $qq . "','" . $date . "','" . $status . "')";
        if ($DB->query($sql)) {
            $DB->query("insert into `meihe_logo` (`czxm`,`cznr`,`time`,`click_time`,`upzid`,`ip_address`) values ('用户注册','用户注册账号成功','" . TIMESTAMP . "','" . $date . "','" . $qq . "','" . real_ip() . "')");
            $row = $DB->get_row("SELECT * FROM meihe_user WHERE user='$user' limit 1");
            $session = md5($user . $pass . $password_hash);
            $token = authcode("{$row['zid']}\t{$session}", 'ENCODE', SYS_KEY);
            setcookie("user_token", $token, time() + 604800, '/');
            $DB->query("update meihe_user set lasttime='$date' where zid='{$row['zid']}'");
            exit('{"code":1,"msg":"注册账号成功！正在自动登录","zid":"' . $row['zid'] . '"}');
        } else {
            exit('{"code":-1,"msg":"注册账号失败！' . $DB->error() . '"}');
        }
        break;
    default:
        exit('{"code":-4,"msg":"No Act"}');
        break;
}
